package com.harvey.guava.functional;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;

import javax.annotation.Nullable;

/**
 * @author harvey
 * @Description 类似Java8的函数式编程
 * @date 2020-03-27 09:40
 * @since
 */
public class FunctionalExample {


    public static void main(String[] args) {
        Function<String, Integer> function = new Function<String, Integer>() {
            @Nullable
            @Override
            public Integer apply(@Nullable String input) {
                Preconditions.checkNotNull(input, "the input String should not be null");
                return input.length();
            }
        };
    }
}

